﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Windows7SlideshowWallpaperUtil
{
    public class WallpaperData : INotifyPropertyChanged 
    {
        private string wallpaper1 = null;
        public string Wallpaper1
        {
            get { return wallpaper1; }
        }

        private string wallpaper2 = null;
        public string Wallpaper2
        {
            get { return wallpaper2; }
        }

        private string wallpaper3 = null;
        public string Wallpaper3
        {
            get { return wallpaper3; }
        }

        private string wallpaper4 = null;
        public string Wallpaper4
        {
            get { return wallpaper4; }
        }

        private string wallpaper5 = null;
        public string Wallpaper5
        {
            get { return wallpaper5; }
        }
        
        public void setWallpaper(string value)
        {
            if (wallpaper1 != value)
            {
                wallpaper5 = Wallpaper4;
                onProperty("wallpaper5");
                wallpaper4 = Wallpaper3;
                onProperty("wallpaper4");
                wallpaper3 = Wallpaper2;
                onProperty("wallpaper3");
                wallpaper2 = Wallpaper1;
                onProperty("wallpaper2");
                wallpaper1 = value;
                onProperty("wallpaper1");
            }
        }
        private void onProperty(String name){
            if(PropertyChanged!=null){
                PropertyChanged(this, new PropertyChangedEventArgs(name));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
